﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Imports Utilerias
Imports Npgsql
Imports MySql.Data.MySqlClient

Public Class EmpresaFact
    Public Shared Function Build(ByVal dr As MySqlDataReader) As empresaBE
        Dim tmpEmpresa As empresaBE = New empresaBE()
        Try
            With tmpEmpresa
                .Correo = convertDTFromDb.ConvertString(dr.Item("Correo"))
                .DF_Calle = convertDTFromDb.ConvertString(dr.Item("DF_Calle"))
                .DF_Colonia = convertDTFromDb.ConvertString(dr.Item("DF_Colonia"))
                .DF_CP = convertDTFromDb.ConvertString(dr.Item("DF_CP"))
                .DF_Estado = convertDTFromDb.ConvertString(dr.Item("DF_Estado"))
                .DF_Localidad = convertDTFromDb.ConvertString(dr.Item("DF_Localidad"))
                .DF_Municipio = convertDTFromDb.ConvertString(dr.Item("DF_Municipio"))
                .DF_NumExt = convertDTFromDb.ConvertString(dr.Item("DF_NumExt"))
                .DF_NumInt = convertDTFromDb.ConvertString(dr.Item("DF_NumInt"))
                .DF_Pais = convertDTFromDb.ConvertString(dr.Item("DF_Pais"))
                .DF_Referencia = convertDTFromDb.ConvertString(dr.Item("DF_Referencia"))
                .IdEmpresa = convertDTFromDb.convertInt32(dr.Item("IdEmpresa"))
                .RazonSocial = convertDTFromDb.ConvertString(dr.Item("RazonSocial"))
                .RFC = convertDTFromDb.ConvertString(dr.Item("RFC"))
                .Sector = convertDTFromDb.ConvertString(dr.Item("Sector"))
                .Telefono = convertDTFromDb.ConvertString(dr.Item("Telefono"))
                .ClavePemex = convertDTFromDb.ConvertString(dr.Item("CvePemex"))
            End With
            Return tmpEmpresa
        Catch ex As Exception
            Throw
        Finally
            tmpEmpresa = Nothing
        End Try
    End Function

End Class
